package seyeralfredo.com.dto;

import javax.persistence.*;

/**
 * Created by Alfredo on 01-Oct-14.
 */
@Entity
@Table(name = "world", schema = "", catalog = "helloworld")
public class WorldDTO {
    private int id;
    private String string1;
    private String string2;

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "string1", nullable = false, insertable = true, updatable = true, length = 20)
    public String getString1() {
        return string1;
    }

    public void setString1(String string1) {
        this.string1 = string1;
    }

    @Basic
    @Column(name = "string2", nullable = false, insertable = true, updatable = true, length = 20)
    public String getString2() {
        return string2;
    }

    public void setString2(String string2) {
        this.string2 = string2;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        WorldDTO worldDTO = (WorldDTO) o;

        if (id != worldDTO.id) return false;
        if (string1 != null ? !string1.equals(worldDTO.string1) : worldDTO.string1 != null) return false;
        if (string2 != null ? !string2.equals(worldDTO.string2) : worldDTO.string2 != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (string1 != null ? string1.hashCode() : 0);
        result = 31 * result + (string2 != null ? string2.hashCode() : 0);
        return result;
    }
}
